/*
Copyright 2022 The Numaproj Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Code generated by Openapi Generator. DO NOT EDIT.

/// SqsSource : SqsSource represents the configuration of an AWS SQS source

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct SqsSource {
    #[serde(rename = "assumeRole", skip_serializing_if = "Option::is_none")]
    pub assume_role: Option<Box<crate::models::AwsAssumeRole>>,
    /// AttributeNames is a list of attributes that need to be returned along with each message. Valid values: All | Policy | VisibilityTimeout | MaximumMessageSize | MessageRetentionPeriod | ApproximateNumberOfMessages | ApproximateNumberOfMessagesNotVisible | CreatedTimestamp | LastModifiedTimestamp | QueueArn | ApproximateNumberOfMessagesDelayed | DelaySeconds | ReceiveMessageWaitTimeSeconds | RedrivePolicy | FifoQueue | ContentBasedDeduplication | KmsMasterKeyId | KmsDataKeyReusePeriodSeconds | DeduplicationScope | FifoThroughputLimit | RedriveAllowPolicy | SqsManagedSseEnabled
    #[serde(rename = "attributeNames", skip_serializing_if = "Option::is_none")]
    pub attribute_names: Option<Vec<String>>,
    /// AWSRegion is the AWS Region where the SQS queue is located
    #[serde(rename = "awsRegion")]
    pub aws_region: String,
    /// EndpointURL is the custom endpoint URL for the AWS SQS API. This is useful for testing with localstack or when using VPC endpoints.
    #[serde(rename = "endpointUrl", skip_serializing_if = "Option::is_none")]
    pub endpoint_url: Option<String>,
    /// MaxNumberOfMessages is the maximum number of messages to return in a single poll. Valid values: 1-10 Defaults to 1
    #[serde(
        rename = "maxNumberOfMessages",
        skip_serializing_if = "Option::is_none"
    )]
    pub max_number_of_messages: Option<i32>,
    /// MessageAttributeNames is a list of message attributes that need to be returned along with each message.
    #[serde(
        rename = "messageAttributeNames",
        skip_serializing_if = "Option::is_none"
    )]
    pub message_attribute_names: Option<Vec<String>>,
    /// QueueName is the name of the SQS queue
    #[serde(rename = "queueName")]
    pub queue_name: String,
    /// QueueOwnerAWSAccountID is the queue owner aws account id
    #[serde(rename = "queueOwnerAWSAccountID")]
    pub queue_owner_aws_account_id: String,
    /// VisibilityTimeout is the duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a ReceiveMessage request. Valid values: 0-43200 (12 hours)
    #[serde(rename = "visibilityTimeout", skip_serializing_if = "Option::is_none")]
    pub visibility_timeout: Option<i32>,
    /// WaitTimeSeconds is the duration (in seconds) for which the call waits for a message to arrive in the queue before returning. If a message is available, the call returns sooner than WaitTimeSeconds. Valid values: 0-20 Defaults to 0 (short polling)
    #[serde(rename = "waitTimeSeconds", skip_serializing_if = "Option::is_none")]
    pub wait_time_seconds: Option<i32>,
}

impl SqsSource {
    /// SqsSource represents the configuration of an AWS SQS source
    pub fn new(
        aws_region: String,
        queue_name: String,
        queue_owner_aws_account_id: String,
    ) -> SqsSource {
        SqsSource {
            assume_role: None,
            attribute_names: None,
            aws_region,
            endpoint_url: None,
            max_number_of_messages: None,
            message_attribute_names: None,
            queue_name,
            queue_owner_aws_account_id,
            visibility_timeout: None,
            wait_time_seconds: None,
        }
    }
}
